home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / emstools.arc / EMMLIB.ARC / EMM26_B.ASM < prev    next >
Assembly Source File  |  1990-02-04  |  5KB  |  92 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM26_B.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_alloc_raw_page_count                                ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns the number of allocated           ;
  7. ;                     non-standard length pages within expanded memory to the ;
  8. ;                     operating system.                                       ;
  9. ;                                                                             ;
  10. ;                     One variety of expanded memory board has a page size    ;
  11. ;                     which is a sub-multiple of 16K bytes.  An expanded      ;
  12. ;                     memory page which is a sub-multiple of 16K is termed a  ;
  13. ;                     raw page.  An operating system may deal with mappable   ;
  14. ;                     physical page sizes which are sub-multiples of 16K      ;
  15. ;                     bytes.                                                  ;
  16. ;                                                                             ;
  17. ;                     If the expanded memory board supplies pages in exact    ;
  18. ;                     multiples of 16K bytes, the number of pages this        ;
  19. ;                     function returns is identical to the number the         ;
  20. ;                     get_unalloc_page_count function returns.  In this case, ;
  21. ;                     there is no difference between a page and a raw page.   ;
  22. ;                                                                             ;
  23. ;           PASSED:   &alloc_raw_pages:                                       ;
  24. ;                        is a far pointer to a count of the number of raw     ;
  25. ;                        pages that are currently unavailable for use.        ;
  26. ;                                                                             ;
  27. ;         RETURNED:   status:                                                 ;
  28. ;                        is the status EMM returns from the call.  All other  ;
  29. ;                        returned results are valid only if the status        ;
  30. ;                        returned is zero.  Otherwise they are undefined.     ;
  31. ;                                                                             ;
  32. ;                     alloc_raw_pages:                                        ;
  33. ;                        is a count of the number of raw pages that are       ;
  34. ;                        currently unavailable for use.                       ;
  35. ;                                                                             ;
  36. ; C USE CONVENTION:   unsigned int status;                                    ;
  37. ;                     unsigned int alloc_raw_pages;                           ;
  38. ;                                                                             ;
  39. ;                     status = get_alloc_raw_page_count (&alloc_raw_pages);   ;
  40. ;-----------------------------------------------------------------------------;
  41. .XLIST
  42. PAGE    60,132
  43.  
  44. IFDEF SMALL
  45.    .MODEL SMALL, C
  46. ENDIF
  47. IFDEF MEDIUM
  48.    .MODEL MEDIUM, C
  49. ENDIF
  50. IFDEF LARGE
  51.    .MODEL LARGE, C
  52. ENDIF
  53. IFDEF COMPACT
  54.    .MODEL COMPACT, C
  55. ENDIF
  56. IFDEF HUGE
  57.    .MODEL HUGE, C
  58. ENDIF
  59.  
  60. INCLUDE emmlib.equ
  61. INCLUDE emmlib.str
  62. INCLUDE emmlib.mac
  63. .LIST
  64. .CODE
  65.  
  66. get_alloc_raw_page_count    PROC                                          \
  67.                 ptr_alloc_raw_pages:FAR PTR WORD
  68.  
  69.     ;---------------------------------------------------------------------;
  70.     ;   do;                                                               ;
  71.     ;   .   get the number of allocated RAW pages from EMM;               ;
  72.     ;---------------------------------------------------------------------;
  73.     MOVE        AX, get_unallocated_raw_pg_cnt_fcn
  74.     INT         EMM_int
  75.  
  76.     ;---------------------------------------------------------------------;
  77.     ;   .   pass the allocated RAW page count back to the caller;         ;
  78.     ;---------------------------------------------------------------------;
  79.     SUB        DX, BX
  80.     MOVE        ES:BX, ptr_alloc_raw_pages
  81.     MOVE        ES:[BX], DX
  82.  
  83.     ;---------------------------------------------------------------------;
  84.     ;   .   return (EMM status);                                          ;
  85.     ;   end;                                                              ;
  86.     ;---------------------------------------------------------------------;
  87.     RET_EMM_STAT    AH
  88.  
  89. get_alloc_raw_page_count    ENDP
  90.  
  91. END
  92.